package run;


import com.epam.task.thread.CallCenter;
import com.epam.task.thread.Client;
import com.epam.task.thread.Operator;

/**
 * Created with IntelliJ IDEA.
 * User: zhunusbekova.arailym
 * Date: 02.09.13
 * Time: 9:25
 * To change this template use File | Settings | File Templates.
 */
public class Runner {


    public static void main(String[] args) throws InterruptedException {
        Client[] clients = new Client[100];
        for (int i = 0; i < clients.length; i++) {
            clients[i].start();
        }
        for (int i = 0; i < clients.length; i++) {
            clients[i].join();
        }

        CallCenter pool = null;
        Operator con = null;

        CallCenter.init();
        pool = CallCenter.getInstance();
        con = pool.takeOperator();

        pool.releaseOperator(con);
        CallCenter.dispose();
    }
}
